package m.fun.model;

import m.common.model.FieldMeta;
import m.common.model.MigrationModel;
import m.common.model.Model;
import m.common.model.TableMeta;
import m.common.model.type.FieldType;
import m.common.model.util.ModelQueryList;
import m.common.model.util.QueryCondition;

import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

@TableMeta(name = "tf_count_info", description = "盘点信息")
public class CountInfo extends BuildOrderModel implements MigrationModel {
    @Override
    public List<String> migrationOidList(String storeOid) throws Exception {
        return ModelQueryList.getModelList(this.getClass(),new String[]{"oid"},null,
                        QueryCondition.eq("store.oid",storeOid))
                .stream().map(Model::getOid).collect(Collectors.toList());
    }
    @FieldMeta(name="count_date",type= FieldType.DATE,description="盘点日期")
    private Date countDate;
    @FieldMeta(name="count_amount",type= FieldType.DOUBLE,description="盘点金额")
    private Double countAmount;
    @FieldMeta(name = "remark",type = FieldType.STRING,length = 1000,description = "备注")
    private String remark;

    public Date getCountDate() {
        return countDate;
    }

    public void setCountDate(Date countDate) {
        this.countDate = countDate;
    }

    public Double getCountAmount() {
        return countAmount;
    }

    public void setCountAmount(Double countAmount) {
        this.countAmount = countAmount;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
